﻿<Window x:Class="com.bodurov.CameraToJpegFilesUI.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:WpfToolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit" 
        Icon="Icon.ico" 
        Title="MainWindow" Height="500" Width="1024" KeyDown="Window_KeyDown">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="25" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="450" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Button x:Name="Trigger" Width="150" Height="25" Content="Start Saving Images" Click="Trigger_Click" />
        <Button x:Name="ViewCamera" Width="150" Height="25" Content="View Camera" Click="ViewCamera_Click" Grid.Column="1" IsEnabled="False" />
        <WpfToolkit:DataGrid x:Name="Files" CanUserAddRows="False" Grid.Row="1" AutoGenerateColumns="False">
            <WpfToolkit:DataGrid.Columns>
                <WpfToolkit:DataGridTextColumn Header="File Name" IsReadOnly="True" Width="340" Binding="{Binding Path=Name}" />
                <WpfToolkit:DataGridTemplateColumn>
                    <WpfToolkit:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Width="80" Height="20" Click="ViewImageButton_Click" DataContext="{Binding Path=Name}">View...</Button>
                        </DataTemplate>
                    </WpfToolkit:DataGridTemplateColumn.CellTemplate>
                </WpfToolkit:DataGridTemplateColumn>
            </WpfToolkit:DataGrid.Columns>
        </WpfToolkit:DataGrid>
        <Border BorderBrush="Black" BorderThickness="3" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1">
            <Image x:Name="CameraView" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="545" Height="410" />
        </Border>
    </Grid>
</Window>
